package com.rc.evcharger.common.constant;

/**
 * 通讯常量
 */
public class SocketConstant extends WebConstant {

    public static final String SPLIT = " ";

    public static final String STR_CON0 = "0";
    public static final String STR_CON1 = "1";
    public static final String STR_CON2 = "2";
    public static final String STR_CON3 = "3";
    public static final String STR_CON4 = "4";
    public static final String STR_CON5 = "5";

    public static final int FAIL = CON0;
    public static final int SUCCESS = CON1;
    public static final int EXCEPTION = CON2;
    public static final int USING = CON3;
    public static final int UNIQUE = CON4;

    //统一心跳
    public static final int HEAR_AGAIN_15 = 15;
    public static final int HEAR_BEAT = 2 * HEAR_AGAIN_15;

    public static final int SH_HEAR_AGAIN_30 = 30;

    //netty端口号
    public static final int DOMAIN1_JZ_NETTY_PROT = 9889;
    public static final int DOMAIN2_JZ_NETTY_PROT = 9999;
    public static final int ZC_NETTY_PROT = 10009; //智充
    public static final int SH_NETTY_PROT = 10109; //盛弘

    public static final String JZ_00_00 = "00 00";
    /**距能 充电桩编号前缀**/
    public static final String JUN_PREFIX_66_66 = "66 66";

    public static final String ZC_LOGIN_SUCCESS = "00";
    public static final String ZC_LOGIN_FAIL = "01";


    public static final String SHAREP_NUM = "00";//尖费率
    public static final String PARK_NUM = "01";//峰费率
    public static final String FLATP_NUM = "02";//平费率
    public static final String LOW_NUM = "03";//谷费率

    /**
     * 0x00 无
     * 0x01 设备编号不匹配
     * 0x02 枪已在充电
     * 0x03 设备故障
     * 0x04 设备离线
     * 0x05 未插枪
     */
    public static final String START_RESP_SUCCESS = "正常";
    public static final String FAIL_RTUA_01 = "设备编号不匹配";
    public static final String FAIL_GUN_USE_02 = "枪已在充电";
    public static final String FAIL_FAULT_03 = "设备故障";
    public static final String FAIL_LOGIN_OUT_04 = "设备离线";
    public static final String FAIL_GUN_NO_05 = "未插枪";

    /**
     * 离线
     */
    public static final int OFF_LINE = CON0;
    /**
     * 在线
     */
    public static final int ON_LINE = CON1;
    /**
     * 正常
     */
    public static final int NORMAL_LINE = CON1;
    /**
     * 故障
     */
    public static final int FAULT_LINE = CON2;

    /**
     * 开始充电
     */
    public static final int POWER_START = CON2;
    /**
     * 停止充电
     */
    public static final int POWER_STOP = CON3;
    /**
     * 交流A枪口
     */
    public static final int GUN_ALTERNAT = CON1;
    /**
     * 直流A枪口
     */
    public static final int GUN_DIRECT = CON3;
    public static final String FAIL_SEND_CODE = "发送指令失败";
    public static final String SUCCESS_SEND_CODE = "发送指令成功";

    public static final String TRADE_CON0 = "00"; //0 表示开始充电上传；1 表示结束充电上传；2 表示终端停电上传；3表示开始放电上传；4 表示结束放电上传；5 表示终端停电上传；
    public static final String TRADE_CON1 = "01";
    public static final String TRADE_CON2 = "02";
    public static final String TRADE_CON3 = "03";
    public static final String TRADE_CON4 = "04";
    public static final String TRADE_CON5 = "05";

    //充电服务器域名,DOMAIN1,DOMAIN2
    public static final String STD_DOMAIN = "STD_DOMAIN";
    public static final String ZC_DOMAIN = "ZC_DOMAIN";


    /**
     * 未充电
     */
    public static final String ORDER_STATUS_NOTUSE = String.valueOf(CON0);
    /**
     * 充电中
     */
    public static final String ORDER_STATUS_USEING = String.valueOf(CON1);
    /**
     * 充电完成
     */
    public static final String ORDER_STATUS_USED = String.valueOf(CON2);
    /**
     * 充电结算中
     */
    public static final String ORDER_STATUS_IN_BALANCE = String.valueOf(CON3);

    /**
     * 日期格式yyyy-MM-dd HH:mm:ss
     */
    public static final String DATA_FORMAT0 = "yyyy-MM-dd HH:mm:ss";


    public final static String SOURCE_ALL = "all";
    public final static String SOURCE_ZHUHAI = "zhuHai";
    public final static String SOURCE_SHENZHEN = "shenZhen";

    public final static String DATE_TYPE_BIN = "bin";
    public final static String DATE_TYPE_BCD = "bcd";
    public final static String DATE_TYPE_ASCII = "ascii";

    public final static int ELEC_NOT = CON0;  //用户没有充电
    public final static int ELEC_USE = CON1;  //用户充电中

    public final static int UNLOCK_SUCCESS = CON1;  //解锁成功
    public final static int UNLOCK_FAIL = CON2;      //解锁失败

    //充电停止情况
    public final static String STOP_FAULT = "故障停止";
    public final static String STOP_HAND = "手动停止";
    public final static String STOP_FULL = "充满停止";
    public final static String STOP_NOT_BALANCE = "余额不足停止";
    public final static String STOP_URGENT = "紧急停止";
    public final static String STOP_AUTO = "自动停止";
    public final static String STOP_PRICE = "电价异常";
    public final static String STOP_ELECLIMIT = "电流过低";
    public final static String STOP_ELECFULL = "充满自动停止";
    public final static String STOP_PILE = "电桩停止";


    /**
     * 停止方式
     * 0: 用户手动停止充电；
     * 1: 客户归属地运营商平台停止充电；
     * 2: BMS 停止充电；
     * 3: 充电机网络异常；
     * 4: 连接器断开
     * 5: 电价异常
     * 6: 余额不足
     * 7: 电流过低停止
     * 8: 充满平台停止
     * 9: 充满停止
     * 10: 电池温度过高停止
     * 11: 电流过高
     * 12: 电压过高
     * 13: 订单已结算
     * 14: 刷卡停止
     * 15: 超时停止
     * 16: 电池温度阈值停止
     * 17: 挂单停止
     */
    public final static int STOP_NORMAL_0X0 = 0x0;
    public final static int STOP_TENANT_0X1 = 0x1;
    public final static int STOP_BMS_0X2 = 0x2;
    public final static int STOP_ELELPILE_INTERNET_EXCEPTION_0x3 = 0x3;
    public final static int STOP_CONNECTOR_EXCEPTION_0x4 = 0X04;
    public final static int STOP_ELEC_PRICE_EXCEPTION_0x5 = 0x5;
    public final static int STOP_BALANCE_LOW_0x6 = 0x6;
    public final static int STOP_ELEC_LOW_0x7 = 0x7;
    public final static int STOP_ELEC_PLATFORM_FULL_0x8 = 0x8;
    public final static int STOP_ELEC_FULL_0x9 = 0x9;
    public final static int STOP_BATTERY_TEMPERATURE_HIGH_0xA = 0xA;
    public final static int STOP_ELEC_HIGH_0xB = 0xB;
    public final static int STOP_VOL_HIGH_0xC = 0xC;
    public final static int STOP_IS_ORDER_0XD = 0xD;
    public final static int STOP_PAY_CARD_0XD = 0xE;
    public final static int STOP_TIMING_0XD = 0xF;
    public final static int STOP_BATTERY_TEMP_0X10 = 0x10;
    public final static int STOP_PENDING_ORDER_0X11 = 0x11;
//    电池温度高
//    High battery temperature


    /**
     * 电枪空闲状态
     */
    public final static int GUN_LEISURE = CON0;
    /**
     * 电枪使用状态
     */
    public final static int GUN_USE = CON1;
    /**
     * 电枪插枪状态
     */
    public final static int GUN_PREPARE = CON2;

    /**
     * 默认停止SOC
     */
    public final static int DEFAULT_LIMIT_SOC = 98;

    public final static int TIME_20_HOUR = 20 * 60 * 60;

    //桩群变动通知KEY
    //public static String wl_notification_stationsstatus_key = "wl_notification_stationsstatus_key";

    //public final static String DISCOUNT_TYPE_RELIEF = CON1;    //桩群折扣
    //public final static String DISCOUNT_TYPE_ACTIVITY = CON2;    //活动电价
}
